{template '_header'}
<style>
    .dropdown-menu li:last-child span {margin: 0}
    .dropdown-menu li span {background: #fff; width: 100%}
    .btn-create {width: 50%}
    center .fa-caret-up {display: none}
    center.open .fa-caret-down {display: none}
    center.open .fa-caret-up {display: inline-block}
    .ibox-content .inner {height: auto; width: 100%}
    .ibox-content .inner .ico {height: 120px; width: 120px; border-radius: 100px; color: #fff; text-align: center; line-height: 120px; margin: 25px auto 35px;}
    .ibox-content .inner .ico .icon {font-size: 80px;}
    .ibox-content .inner .text {width: 80%; margin: auto; padding-bottom: 20px; text-align: center;}
	.dropdown-menu li{background-color:#e7eaec;text-align:center; }
	.dropdown-menu li{padding:5px 0px;border:1px solid #f2f2f2;border-radius:5px;}
	.float-e-margins .btn {
    margin-bottom: 0px;
}
</style>

<div class="page-heading">
    <h2><i class="fa fa-circle-o"></i>请选择页面类型</h2>
</div>

{php $col=$_W['plugin']!='merch'?'col-md-3 col-sm-3':'col-md-4 col-sm-4'}
{php $margin=$_W['plugin']!='merch'?'-42%':'-28%'}

<div class="row">
    {ifp 'diypage.page.sys.add'}
        <div class="{$col}">
            <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
                <div class="ibox-title">
                    <h5>系统页面</h5>
                </div>
                <div class="ibox-content">
                    <div class="inner">
                        <div class="ico" style="background: #1ab394; ">
                            <i class="icon icon-shop"> </i>
                        </div>
                        <div class="text">此类型页面可替换商城系统页面</div>
                    </div>
                    <center style="position: relative; width: 100%">
                        <span class="btn btn-w-m btn-primary btn-create" style="color:white;" data-toggle="dropdown"><i class="fa fa-caret-down"></i><i class="fa fa-caret-up"></i> 立即创建</span>
                        <ul role="menu" class="dropdown-menu clearfix" style="left: 80%; margin-left: {$margin}; width: 50%; background: none; border: none; box-shadow: none; padding: 0;">
                            <li><span class="btn btn-w-m btn-block btn-outline btn-primary btn-jump" style="max-width: 70%;color:white;" data-href="{php echo webUrl('diypage/page/sys/add', array('type'=>2))}"><i class="fa fa-plus"></i> 商城首页</span></li>
                            {if $_W['plugin']!='merch'}
                                <li><span class="btn btn-w-m btn-block btn-outline btn-primary btn-jump" style="max-width: 70%;color:white;" data-href="{php echo webUrl('diypage/page/sys/add', array('type'=>3, 'tid'=>$tid_member))}"><i class="fa fa-plus"></i> 会员中心</span></li>
                                <li><span class="btn btn-w-m btn-block btn-outline btn-primary btn-jump" style="max-width: 70%;color:white;" data-href="{php echo webUrl('diypage/page/sys/add', array('type'=>5, 'tid'=>$tid_detail))}"><i class="fa fa-plus"></i> 商品详情页</span></li>
                            {/if}
                        </ul>
                    </center>
                </div>
            </div>
        </div>
    {/if}

    {if $_W['plugin']!='merch'}
        {ifp 'diypage.page.plu.add'}
            <div class="col-md-3 col-sm-3">
                <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
                    <div class="ibox-title">
                        <h5>应用页面</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="inner">
                            <div class="ico" style="background: #ed5565; ">
                                <i class="icon icon-app"> </i>
                            </div>
                            <div class="text">此类型页面可替换商城应用页面</div>
                        </div>
                        <center style="position: relative; width: 100%">
                            <span class="btn btn-w-m btn-danger btn-create" data-toggle="dropdown"><i class="fa fa-caret-down"></i><i class="fa fa-caret-up"></i>  立即创建</span>
                            <ul role="menu" class="dropdown-menu" style="left: 80%;  margin-left: -42%; width: 50%; background: none; border: none; box-shadow: none; padding: 0;">
                                {if p('commission')}
                                    <li><span class="btn btn-w-m btn-block btn-outline btn-danger btn-jump" style="max-width: 70%" data-href="{php echo webUrl('diypage/page/plu/add', array('type'=>4, 'tid'=>$tid_commission))}"><i class="fa fa-plus"></i> 分销中心</span></li>
                                {/if}
                                {if p('creditshop')}
                                    <li><span class="btn btn-w-m btn-block btn-outline btn-danger btn-jump" style="max-width: 70%" data-href="{php echo webUrl('diypage/page/plu/add', array('type'=>6, 'tid'=>$tid_creditshop))}"><i class="fa fa-plus"></i> 积分商城</span></li>
                                {/if}
                                {if p('seckill')}
                                    <li><span class="btn btn-w-m btn-block btn-outline btn-danger btn-jump" style="max-width: 70%" data-href="{php echo webUrl('diypage/page/plu/add', array('type'=>7, 'tid'=>$tid_seckill))}"><i class="fa fa-plus"></i> 整点秒杀</span></li>
                                {/if}
                                {if p('exchange')}
                                    <li><span class="btn btn-w-m btn-block btn-outline btn-danger btn-jump" style="max-width: 70%" data-href="{php echo webUrl('diypage/page/plu/add', array('type'=>8, 'tid'=>$tid_exchange))}"><i class="fa fa-plus"></i> 兑换中心</span></li>
                                {/if}
                            </ul>
                        </center>
                    </div>
                </div>
            </div>
        {/if}
    {/if}

    {ifp 'diypage.page.diy.add'}
        <div class="{$col}">
            <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
                <div class="ibox-title">
                    <h5>自定义页面</h5>
                </div>
                <div class="ibox-content">
                    <div class="inner">
                        <div class="ico" style="background: #1c84c6; ">
                            <i class="icon icon-paint"> </i>
                        </div>
                        <div class="text">此类型页面可通过链接或关键字进入</div>
                    </div>
                    <center>
                        <span class="btn btn-w-m btn-success btn-create btn-jump" data-href="{php echo webUrl('diypage/page/diy/add')}"><i class="fa fa-plus"></i> 立即创建</span>
                    </center>
                </div>
            </div>
        </div>
    {/if}

    {ifp 'diypage.temp'}
        <div class="{$col}">
            <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
                <div class="ibox-title">
                    <h5>通过模版创建</h5>
                </div>
                <div class="ibox-content">
                    <div class="inner">
                        <div class="ico" style="background: #f8ac59; ">
                            <i class="icon icon-copy2"> </i>
                        </div>
                        <div class="text">可通过已有模板创建新的页面</div>
                    </div>
                    <center>
                        <span class="btn btn-w-m btn-warning btn-create btn-jump"  data-href="{php echo webUrl('diypage/temp')}"><i class="fa fa-plus"></i> 立即选择模版</span>
                    </center>
                </div>
            </div>
        </div>
    </div>
{/if}

<div class="row" style="padding: 0;">
    <div class="col-sm-12">
        <div style="border: 1px solid #e7eaec;" class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>页面类型介绍</h5>
            </div>
            <div class="ibox-content">
                <p></p>
                <p>系统页面：可根据自己需求、样式编辑好页面，替换系统默认模板，目前支持商城首页、商品详情页、会员中心。</p>
                {if $_W['plugin']!='merch'}
                <p>应用页面：可根据自己需求、样式编辑好页面，替换应用默认模板{if p('commission')||p('creditshop')||p('seckill')||p('exchange')}，目前支持{if p('commission')}分销中心{/if}{if p('creditshop')}、积分商城{/if}{if p('seckill')}、整点秒杀{/if}{if p('exchange')}、兑换中心{/if}。{else}。{/if}</p>
                {/if}
                <p>自定义页面：可根据自己需求、样式编辑好页面，通过链接、关键字、或其他页面跳转进入，实现专题页面的需求。</p>
                <p>通过模板创建：可将喜欢的页面、使用率较高的页面保存成模板，根据已保存的模板一键创建页面，省时、省力、省心。</p>
            </div>
        </div>
    </div>
</div>

{ifp 'diypage.shop.page'}
    <div class="row">
        <div class="col-sm-12">
            <a class="btn btn-default btn-block" href="{php echo webUrl('diypage/shop/page')}"> 已有编辑好的页面？立即替换系统模板</a>
        </div>
    </div>
{/if}

<script type="text/javascript">
    $(function () {
        $(".btn-jump").click(function(){
            var href = $(this).data('href');
            if(!href) {
                tip.msgbox.err("暂未开放此类型！敬请期待。");
                return;
            }
            $(this).closest("center").find(".btn-create").html('<i class="fa fa-spinner fa-spin"></i> 加载中...');
            location.href = href;
        });
    });
</script>

{template '_footer'}